//
// Created by RandBII on 2020/12/24.
//

#ifndef FFMPEGFORANDROID_NATIVERENDER_H
#define FFMPEGFORANDROID_NATIVERENDER_H

#include <android/native_window.h>
#include <android/native_window_jni.h>
#include <jni.h>
#include "VideoRender.h"

class NativeRender : public VideoRender {
public:
    NativeRender(JNIEnv *evn, jobject surface);

    virtual ~NativeRender();

    virtual void Init(int videoWidth, int videoHeight, int *dstSize);

    virtual void RenderVideoFrame(NativeImage *pImage);

    virtual void UnInit();


private :
    ANativeWindow_Buffer mNativeWindowBuffer{};
    ANativeWindow *mNativeWindow = nullptr;
    int mDstWidth{};
    int mDstHeight{};
};


#endif //FFMPEGFORANDROID_NATIVERENDER_H
